import http from "../utils/request.js"

// 获取vip产品
export let getVip = (category_id) => http.get("/product/get_product", {
    params: {
        category_id
    },
    headers: {
        authorization: sessionStorage.getItem("data")
    }
})

// 下单
export const preOrderApi = (product_id, quantity) => http.post("/order/pre_order", {
    product_id,
    quantity
})


// 发起支付
export const paymentApi = (order_id) => http.post("/pay/payment", {
    order_id
})

// 查询支付结果
export const queryApi = (order_id) => http.get("/order/query_order_status", {
    params: {
        order_id
    }
})


// 获取订单
export const getOrderApi = (order_id = '') => http.post("/order/get_order", {
    params: {
        order_id
    }
})

// 删除订单
export const delOrderApi = (order_id) => http.get("/order/del_order",{
    params:{
        order_id
    }
})